<% layout('/layouts/default.html', {title: '考试预约管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> 考试预约管理
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="查询"><i class="fa fa-filter"></i> 查询</a>
				<% if(hasPermi('tm:smTestOrder:edit')){ %>
					<a href="${ctx}/tm/smTestOrder/form" class="btn btn-default btnTool" title="新增考试预约"><i class="fa fa-plus"></i> 新增</a>
				<% } %>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${smTestOrder}" action="${ctx}/tm/smTestOrder/listData" method="post" class="form-inline"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">姓名：</label>
					<div class="control-inline">
						<#form:input path="student.name" maxlength="50" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">考试日期：</label>
					<div class="control-inline">
						<#form:input path="testDate" readonly="true" maxlength="20" class="form-control Wdate-date"
							dataFormat="date" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">所属驾校：</label>
					<div class="control-inline">
						<#form:input path="officeId" maxlength="64" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">预约时间：</label>
					<div class="control-inline">
						<#form:input path="orderDate" readonly="true" maxlength="20" class="form-control Wdate-datetime"
							dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">查询</button>
					<button type="reset" class="btn btn-default btn-sm">重置</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'考生证件号', name:'studentIdno', index:'a.student_idno', width:150, align:"left", frozen:true, formatter: function(val, obj, row, act){
			return '<a href="${ctx}/tm/smTestOrder/form?id='+row.id+'" class="btnList" data-title="编辑考试预约">'+(val||row.id)+'</a>';
		}},
		{header:'姓名', name:'student.name', index:'a.student_name', width:150, align:"center"},
		{header:'性别', name:'student.sex', index:'a.sex', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('sys_user_sex')}, val, '未知', true);
		}},
		{header:'考生电话', name:'student.telephone', index:'a.telephone', width:150, align:"left"},
		{header:'考试科目', name:'subject', index:'a.subject', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('DSMS_KSKM')}, val, '未知', true);
		}},
		{header:'考试日期', name:'testDate', index:'a.test_date', width:150, align:"center"},
		{header:'考试场地', name:'testAddr', index:'a.test_addr', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('DSMS_KSCD')}, val, '未知', true);
		}},
		{header:'所属驾校', name:'school.officeName', index:'a.office_id', width:150, align:"center"},
		{header:'预约时间', name:'orderDate', index:'a.order_date', width:150, align:"center"},
		{header:'操作', name:'actions', width:120, sortable:false, title:false, formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('tm:smTestOrder:edit')){ %>
				actions.push('<a href="${ctx}/tm/smTestOrder/form?id='+row.id+'" class="btnList" title="编辑考试预约"><i class="fa fa-pencil"></i></a>&nbsp;');
				actions.push('<a href="${ctx}/tm/smTestOrder/delete?id='+row.id+'" class="btnList" title="删除考试预约" data-confirm="确认要删除该考试预约吗？"><i class="fa fa-trash-o"></i></a>&nbsp;');
			<% } %>
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>